widget: guard popover-specific code paths
authorMatthias Clasen <mclasen@redhat.com>
Sun, 24 Feb 2019 23:41:26 +0000 (18:41 -0500)
committerMatthias Clasen <mclasen@redhat.com>
Tue, 28 May 2019 19:54:32 +0000 (19:54 +0000)
This is essentially a special case just for GtkPopover,
which is the last widget with a child surface.

gtk/gtkwidget.c

index 0bdbf2ed8ef60a09ba09dec7c8f78fd6f5e81c88..4f1d444cecb8e7d266122f911aa8a3361610228d 100644 (file)
@@ -4439,7 +4439,8 @@ gtk_widget_allocate (GtkWidget    *widget,
     {
       /* Still have to move the window... */
       if (_gtk_widget_get_realized (widget) &&
-          _gtk_widget_get_has_surface (widget))
+          _gtk_widget_get_has_surface (widget) &&
+          GTK_IS_POPOVER (widget))
          {
            GtkAllocation window_alloc;
 
@@ -4652,7 +4653,8 @@ gtk_widget_real_size_allocate (GtkWidget *widget,
   GtkWidgetPrivate *priv = gtk_widget_get_instance_private (widget);
 
   if (_gtk_widget_get_realized (widget) &&
-      _gtk_widget_get_has_surface (widget))
+      _gtk_widget_get_has_surface (widget) &&
+      GTK_IS_POPOVER (widget))
      {
        GtkAllocation window_alloc;